Data Files

This section describes the five data files that support creation of calendars: preference files, translation files, FWCAddEvent data files, history files, and random files. The preference file is used both to generate a calendar and to later add events to that calendar. The translation file is used to translate the information in the requesters to your language. The FWCAddEvent data file is used to enter pre-defined event data with FWCAddEvent. The history file allows you to add a 'day in history' event to the generated calendar. Finally, the random file allows you to add a random entry to the generated calendar. None of these files are necessary for FWCalendar or FWCAddEvent to work properly; if the files are absent, internal defaults will be used as appropriate.

Preference Files
Preference files contain highlight and image information and variable values that differ from FWCalendar's defaults. There are over 100 user-definable
variables that contain, among others, format, color, and font information; the variables are set using the Variable Editor. Different preference files can be maintained for generating different calendar styles.

To create a new preference file, click the "Reset" button; this will set all variables to their default values. In this case, if variables have been changed from their default settings when you generate a calendar, you will be prompted for the filename of the new preference file. The loaded preference file, along with any changes just made, can be saved under a new name using the "Save as" button.

Both FWCalendar and FWCAddEvent use the same preferences file for initializing variables, so you should not change the preferences between using FWCalendar and FWCAddEvent. See notes on the Variable Editor for more details.

Highlights are also contained in the preference file, and are added using the Highlight Editor (see the Variables tab of the Variable Editor). Highlight is the term used to describe holidays, anniversaries, birthdays, and other notable dates added to the calendar as it is being generated. Events that do not repeat themselves every year (at least not at the same time) are added after the calendar is generated using FWCAddEvent). There is no design limitation on the number of highlights that can be assigned, since multiple highlights can be assigned for each day of the year.

Images (also added using the Highlight Editor (see the Variables tab of the Variable Editor)) can be inserted in the center of certain dates such as birthdays, anniversaries, and other days. The images can be inserted whether or not a highlight is inserted on that date. Only one image can be inserted for a given day.

Translation Files
Translation files exist for several of the supported languages (thanks in large part to those non-American users who want to make FWCalendar look good for their country). To create a translation file, simply take the FWCTranslations file (found in the American folder in this distribution) and translate the American phrases to phrases in your language. If you develop new translation file, please submit it to me so I can include it with future distributions.

FWCAddEvent Data
Certain events may need to be added to the calendar each month, always in the same order and always the same number of days apart (such as a rotating work schedule). Or you may want to add the same events to numerous calendars with different formats. In these cases, it may be convenient to pre-define these events and enter them automatically. To do so, select the "File" option from the upper-left gadget of the FWCAddEvent requester, then select the pre-defined event data file.

The pre-defined event data file can have any name and be located anywhere. When the file requester appears, the default directory will be the same as the location of the other FWCalendar files. The data file consists of sets of lines containing the following keywords:

Start    The actual start day of the event. If a start day was entered in the FWCAddEvent requester, this value represents the offset from that "root date" (this value is used to calculate the event's actual start date. For example, if 12 was selected as the start day and Start is set to 4, then the actual start date of the event would be the 16th). This keyword is required.
End    The actual end day of the event. If a start day was entered in the FWCAddEvent requester, this value represents the offset from that "root date" (this value is used to calculate the event's actual end date. For example, if 12 was selected as the start day and End is set to 6, then the actual end date of the event would be the 18th). If omitted,End will be set equal to Start.
Font    If the host application is Final Writer, the full path and name of the desired font; if the host application is PageStream, the name of an installed font. If omitted, the font defined by Font.Highlight will be used.
Size    The desired font size (will be truncated to a whole number if the host application is Final Writer). If omitted, the calculated font size (based on AddEventRows) will be used.
Line    The line number to used for the event (0 - 16)�. If omitted, the event will be printed on line one.
Options    B for boxed, W for Weekly, 2 for Biweekly (only one of W or 2 can be used, but either can be used in conjunction with B.). If omitted, the event will not be boxed (unless it is a multi-day event) and it will not be repeated for succeeding weeks.
TextColor    The color (eg, blue or red) to be used for the event text. If omitted, the event will be printed in black or in the color defined by Color.AddEvent.
BoxColor    The color (eg, blue or red) to be used for the box's background. If omitted, the box (if drawn) will be clear or the color defined by Background.AddEvent.
Event    The event (if single or double quotes are used, they will be included on the calendar). This keyword is required.

These keywords and their values can appear in any order, but there must be a blank space on either side of the "= " sign. Events groups are separated by a blank line, and comment lines (beginning with '/*') will be ignored. Only Start and Event are required; this will cause the event to be printed on line one of start day (unless a day was selected as the "root date" in the FWCAddEvent requester).

Unboxed, single-day events will have subsequent lines indented. The text will be split between lines automatically, so there is no need to indicate specific line breaks; if desired, line breaks can be indicated by inserting ' //' where the line break is desired. Boxed events have all lines centered.

IMPORTANT: note that if a Start day is given in the FWCAddEvent requester, both Start and End are offsets from the "root date" selected in the FWCAddEvent requester. If the "root date" is the first day of October, for example, the keyword pair Start = 5, End = 8 will cause the event to span October 6 through October 9.

Examples (assume no Start day given in the FWCAddEvent requester):
Start = 1
Event = Testing
Testing (without quotes) will be inserted on line one of the first day of the month
Start = 5
End = 6
Line = 2
Event = "Testing"
"Testing" (including quotes) will be inserted (and boxed because it spans more than one day) on line 2 of the 5th and 6th of the month
Start = 4
Line = 1
Font = Zapf-Chancery
Size = 12
TextColor = Green
BoxColor = Blue
Options = bw
Event = 'FWCalendar is Great!'
'FWCalendar is Great!' (including single quotes) will be inserted with green, 12-pt, Zapf-Chancery text, backed by a blue box, on line 1 of the 4th of the month. This will be repeated weekly through the end of the calendar
Start = 15
Line = 4
Options = 'B'
Event = Teacher Conferences//No School
Teacher Conferences will be centered on line 4 and No School will be centered on line 5 of the 15th of the month. The pair of lines will be backed by a box of the color defined in the appropriate data file (or white if the default data was used).

History Data
The history data is a directory (named FWCHistory and located in the same directory as FWCalendar.rexx) containing 12 text files (named 01, 02, 03, ..., 12), one for each month of the year. Each text file contains lines of data to be associated with specific days of the month. The data can be whatever you'd like it to be, including historical birthdays or historical events (the history data included with this distribution includes historical birthdays garnered from the internet).

If there is only one event noted for a particular date, that event will be entered on the calendar as it is generated. If there are multiple events noted for a date, however, one will be chosen at random and entered on the calendar as it is generated.

Each line in the data files has the format

|4 1643 - Sir Isaac Newton

Every line begins with "|" to allow quick location of new lines and to provide a method for counting events.

The next part of the data line consists of the day of the month with which the event is associated. In the example above, the 4 indicates that the event should be associated with the 4th of the month. Everything following the day will be entered as the event, exactly as shown on the line.

Groups of days are separated by single lines containing only the "|" character:

|4 1643 - Sir Isaac Newton
|4 1809 - Louis Braille
|
|5 1779 - Stephen Decatur
|5 1938 - Juan Carlos I
|

Random Data
The random file is named FWCRandom.txt and must be located in the same directory as FWCalendar.rexx.

This feature is similar to adding a random tagline to the end of emails as they are sent. The data file simply consists of text lines, each preceded by the "|" character. Everything after the "|" will be entered on the calendar as it is generated. The file included with this distribution contains thoughts for the day that are intended not to offend anyone.

The number of lines that will actually fit in a given date is determined by the font and the HighlightRows variable. The number of lines that will fit on half-size days (days at the end of the month that are split) will be less than the full complement of lines. Certain lines may also be filled by Highlights added during generation of the calendar; events added to these lines would overwrite the highlights.